Add bootinfo tag#536
Draft
terryzbai wants to merge 8 commits into
Draft
Conversation
Previously, the ELF code treats program headers = segments. While this worked originally, it broke for cases that requires >= 2 program headers to refer to the same segment. Now, when the ELF is parsed, the code will create a 1-1 mapping of segments to program headers like before. But the allow for additional program headers to be inserted. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Added `pub fn phdrs_table(&self) -> Vec<(ElfProgramHeader64, usize)>` to ELF code. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Modified `pub fn add_segment()` to allow for an additional program header in the ELF to describe the segment with a user defined type identifier. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Which also required changes to how the spec is packed into the intialiser. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
dreamliner787-9
suggested changes
Jun 25, 2026
d0ee81f to
a9ba769
Compare
a9ba769 to
cd0b3e5
Compare
midnightveil
approved these changes
Jun 26, 2026
midnightveil
left a comment
Collaborator
There was a problem hiding this comment.
Approving, but this needs the dependant rust-sel4 changes merged first.
cd0b3e5 to
3009d5d
Compare
This extends MRs to get prefilled with BootInfo by the capDL initialiser. One can specify the expected BootInfo type via 'prefill_bootinfo', and map it to PDs like other MRs. This is useful for the cases where the userland needs to access some of boot information, e.g., RSDP in ACPI driver. Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
This adds an example showing how to map a bootinfo-prefilled MR to a PD. As the DTB is not passed through by Microkit loader, it isn't obvious to demonstrate the feature on ARM and RISC-V. For x86, this example reads the TSC frequency and prints it. Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
Add feature explanation for bootinfo prefilling to manual. Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
This adds two test cases for bootinfo prefilling feature: test_mr_prefill_bootinfo_valid: the tool should successully parse the SDF that includes a valid bootinfo prefilling MR. test_mr_prefill_path_bootinfo_both_specified: the error should be detected when both 'prefill_path' and 'prefill_bootinfo' are specified. Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
3009d5d to
965ff5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is rebased on branch rust_sel4_update_to_main, which should be merged soon. The proposed feature is included in the only last 3 commits.
This PR adds the
bootinfotag to map specified type of bootinfo into PD's vspace, and patch the address to pre-declared variablebootinfo_{bi_type}. This is useful for the cases where the userspace applications needs to consume bootinfo, e.g., RSDP in ACPI driver, TSC used as clock source, etc.The usage of
bootinfotag is added in the examplex86_64_ioport. It works with this rust-sel4 PR on x86 to show how TSC frequency is mapped and read by a PD.